/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PasswordDialog.java
 *
 * Created on Sep 21, 2009, 2:03:21 AM
 */

package cccs.utility;

import java.awt.event.*;

/**
 *
 * @author George
 */
public class PasswordDialog extends javax.swing.JPanel{
    public class PasswordListener extends ComponentAdapter{
        public void componentShown(ComponentEvent e) {
            jPasswordField1.grabFocus();
            //jPasswordField1.requestFocus();
        }
    }

    /** Creates new form PasswordDialog */
    public PasswordDialog() {
        initComponents();
    }

    public PasswordDialog(String label) {
        this();
        jLabel1.setText(label);
    }

    public String getPassword(){
        return String.copyValueOf(jPasswordField1.getPassword());
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPasswordField1 = new javax.swing.JPasswordField();
        jLabel1 = new javax.swing.JLabel();

        jPasswordField1.setName("jPasswordField1"); // NOI18N

        jLabel1.setText("Enter your password ");
        jLabel1.setName("jLabel1"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel1)
            .addComponent(jPasswordField1, javax.swing.GroupLayout.DEFAULT_SIZE, 229, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPasswordField1))
        );
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPasswordField jPasswordField1;
    // End of variables declaration//GEN-END:variables

}
